<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="zh">
<head>
<meta charset="utf-8" />
<title>SaltStack Admin - 主机管理</title>
<meta name="description" content="Luxiaok" />
<meta name="keywords" content="Luxiaok" />
<!-- We need to emulate IE7 only when we are to use excanvas -->
<!--[if IE]>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<![endif]-->
<!-- Favicons --> 
<link rel="shortcut icon" type="image/png" href="/static/images/favicons/favicon.png"/>
<link rel="icon" type="image/png" href="/static/images/favicons/favicon.png"/>
<link rel="apple-touch-icon" href="/static/images/favicons/apple.png" />
<!-- Main Stylesheet --> 
<link rel="stylesheet" href="/static/css/main.css" type="text/css" />
<!-- Your Custom Stylesheet --> 
<link rel="stylesheet" href="/static/css/custom.css" type="text/css" />
<!-- 用户列表css样式 --> 
<link rel="stylesheet" href="/static/css/tables.css" type="text/css" />
<!-- jQuery with plugins -->
<script type="text/javascript" src="/static/js/jquery-1.8.3.min.js"></script>
<!--
Could be loaded remotely from Google CDN : 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
-->
<!-- Superfish Navigation -->
<script type="text/javascript" src="/static/js/jquery.superfish.min.js"></script>
<script type="text/javascript" src="/static/js/jquery.supersubs.min.js"></script>
<!-- 删除主机确认函数 -->
<script type="text/javascript" src="/static/js/hosts.js"></script>
<!-- 顶部导航和底部隐藏的导航的特效输出 -->
<script type="text/javascript" src="/static/js/nav.show.menu.js"></script>
</head>
<body>
	<!-- Header -->
	<%include file="header.html" args="curM='hosts',ShowName=ShowName,uid=uid" />
	<!-- End of Header -->
	<!-- Page title -->
	<div id="pagetitle">
		<div class="wrapper">
			<h1>主机管理</h1>
			<!-- Quick search box -->
			<form action="" method="get"><input class="" type="text" id="q" name="q" /></form>
		</div>
	</div>
	<!-- End of Page title -->
	
	<!-- Page content -->
	<div id="page">
		<!-- Wrapper -->
		<div class="wrapper">
	      <div>
		  <table width=100%>
		  <tr>
			  <td><h3>主机列表</h3></td>
			  <td align='left'>按主机角色显示：<select name="show4role" id="show4role" class="" onchange="onSearch('show4role',7)">
                      <option value=""  selected="selected">所有角色</option>
                      % for x in sortShow['role']:
                      <option value="${x['value']}">${x['value']}</option>
                      % endfor
                 </select>
                  　　按IDC机房显示：<select name="show4idc" id="show4idc" class="" onchange="onSearch('show4idc',6)">
                      <option value=""  selected="selected">所有IDC</option>
                      % for x in sortShow['idc']:
                      <option value="${x['value']}">${x['value']}</option>
                      % endfor
                 </select>                
                  　　显示行数：<select name="showline" id="showline" class="">
                      <option value="all"  selected="selected">所有行</option>
                      <option value="line10">10 行</option>
                      <option value="line20">20 行</option>
                      <option value="line50">50 行</option>
                      <option value="line100">100行</option>
                      <option value="line200">200行</option>
                      <option value="line500">500行</option>
                  </select>			
			  </td>
              <td align='right'><a href="/hosts/add" class="btn"><span class="icon icon-add">&nbsp;</span>添加主机</a></td>
          </tr>
          </table>					
					<table class="datalist" id="datalist">
						<thead>
						    <tr>
							<th>ID</th>
							<th>主机名</th>
							<th title="试试将鼠标放在有&#13;下划线的内网IP上&#13;可查看公网IP">内网IP</th>
							##<th>公网IP</th>
							<th>硬盘</th>
							<th>内存</th>
							<th>操作系统</th>
							<th>IDC归属</th>
							<th>角色</th>
							<th>类型</th>
							<th>型号</th>
							<th>Salt状态</th>
							<th>操作管理</th>
					        </tr>
						</thead>
						<tbody>
							% for i in getHosts:
							    <%
							        hid = i.id
							        hostname = i.hostname
							        priip1 = i.priip1
							        pubip1 = i.pubip1        
							        hdd = i.hdd
							        mem = i.mem
							        os = i.os
							        idc = i.idc
							        idctag = i.idctag
							        role = i.role
							        type = i.type
							        model = i.model
							        status = i.status
							        creator = i.creator
							        editor = i.editor
							        mdate = i.mdate
							    %>
							<tr class="dataline">
							  <td>${hid}</td>
							  <td title="${hostname}&#10;创建者：${creator}&#10;修改者：${editor}&#10;修改时间：${mdate}" class="point">${hostname}</td>
							  % if len(pubip1):
							  <td title="公网IP：${pubip1}" style="cursor:pointer"><u>${priip1}</u></td>
							  % else:
							  <td>${priip1}</td>
							  % endif
							  ##<td>${pubip1}</td>							  
							  <td>${hdd}</td>
							  <td>${mem}</td>
                                                          <td>${os}</td>
                                                          <td title="机柜编码：${idctag}" style="cursor:pointer">${idc}</td>
                                                          <td>${role}</td>
                                                          <td>${type}</td>
                                                          <td>${model}</td>
                                                          <td>${status}</td>
							  <td><a href="/hosts/edit?pid=${hid}">详情</a> | <a href="/hosts/del?pid=${hid}" onClick="return isDel()">删除</a> | <a href="/hosts/edit?pid=${hid}">编辑</a> | <a href="/hosts/admin?pid=${hid}">管理</a></td>
							</tr>
							% endfor
						</tbody>
						<tfoot>
							<tr>
							<th>ID</th>
							<th>主机名</th>
							<th>内网IP</th>
							##<th>公网IP</th>
							<th>硬盘</th>
							<th>内存</th>
							<th>操作系统</th>
							<th>IDC归属</th>
							<th>角色</th>
							<th>类型</th>
							<th>型号</th>
							<th>Salt状态</th>
							<th>操作管理</th>
							</tr>
						</tfoot>
					</table>
	      </div>
		</div>
		<!-- End of Wrapper -->
	</div>
	<!-- End of Page content -->
<%include file="footer.html" />	
</body>
</html>
